package api

import (
	"fmt"
	"gitee.com/tang_q/gin-vue3-admin-api/model/dto"
	"gitee.com/tang_q/gin-vue3-admin-api/model/family"
	"github.com/gin-gonic/gin"
)

type TangFamilyApi struct {
	BaseApi
}

func NewTangFamilyApi() TangFamilyApi {
	return TangFamilyApi{
		BaseApi: NewBaseApi(),
	}
}

func (T TangFamilyApi) GetFamilyTangList(g *gin.Context) {
	T.ctx = g
	querydata := dto.TangFamilyQueryDTO{}
	if err := g.ShouldBind(&querydata); err != nil {
		T.Fail(201, "参数错误"+fmt.Sprintf("%v", err), nil)
	}
	list, err := family.GetTangFamilyList(querydata)
	if err != nil {
		T.Fail(201, "获取失败"+fmt.Sprintf("%v", err), nil)
	}
	T.Success("ok", list)

}
